package com.neusoft.mapper;

import com.neusoft.core.Deal;
import org.apache.ibatis.annotations.*;

@Mapper
public interface DealMapper {
   @Insert("INSERT INTO deals(amount, createTime, fromWalletId, toWalletId, status) " +
           "VALUES(#{amount}, #{createTime}, #{fromWalletId}, #{toWalletId}, #{status})")
   @Options(useGeneratedKeys = true, keyProperty = "dealId", keyColumn = "dealId")
    int saveDeal(Deal deal);
    
    @Update("UPDATE deals SET status = #{status} WHERE dealId = #{dealId}")
    int updateStatus(Integer dealId, int status);
}
